import Vue from 'vue'
import App from './App.vue'


// 加载路由配置文件     router/index.js
import router from './router/index.js'

// 加载中间件store
import store from './store/base.js'


// 加载swier插件
// import VueAwesomeSwiper from './assets/css/swiper.min.css'
// Vue.use(VueAwesomeSwiper);
import VueAwecomeSwiper from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css'
Vue.use(VueAwecomeSwiper)

//引入弹窗提示模块
import {
  Alert,
  Confirm,
  Toast
} from 'wc-messagebox'
//引入该模块样式文件
import 'wc-messagebox/style.css'

Vue.use(Alert)
Vue.use(Confirm)
Vue.use(Toast)

// 引入axios模块
import axios from 'axios'
// Vue.use(axios)
Vue.prototype.$axios = axios

//加载百度地图模块
import BaiduMap from 'vue-baidu-map'
Vue.use(BaiduMap, {
  // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key /
  ak: '9N7pUjbkmkI4X5HdwGZqzTBYuaKvnV7z'
})




router.beforeEach((to, from, next) => {
  //to and from are Route Object,next() must be called to resolve the hook
  if (to.meta.title) {
    document.title = to.meta.title;
  }
  next();
})


new Vue({
  router,
  store,
  render: h => h(App),
}).$mount('#app')